import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/loginto',
  },

  {
    path: '/layout',
    component: () => import('@/layout/index'),
    children: [
      {
        path: '/layout',
        redirect: '/layout/home',
      },
      {
        path: '/layout/home',
        component: () => import('@/views/Home/index.vue'),
        redirect: '/main',
        children: [
          {
            path: '/main',
            name: 'main',
            component: () => import('@/views/Home/main/index.vue'),
          },
          {
            path: '/newshop',
            name: 'newshop',
            component: () => import('@/views/Home/newShop/index.vue'),
          },
        ],
      },
      {
        path: '/layout/my',
        component: () => import('@/views/My/my.vue'),
      },
      {
        path: '/layout/yue',
        component: () => import('@/views/My/yue/yue.vue'),
      },
      {
        path: '/layout/type',
        component: () => import('@/views/type/index.vue'),
      },
    ],
  },
  {
    path: '/kill',
    component: () => import('@/views/kill'),
  },
  {
    path: '/bargaining',
    component: () => import('@/views/Bargaining'),
  },
  {
    path: '/orderArea',
    component: () => import('@/views/order/index.vue'),
  },
  {
    path: '/streaming',
    component: () => import('@/views/streaming/index.vue'),
  },
  {
    path: '/loginto',
    component: () => import('@/views/Login/login.vue'),
  },
  {
    path: '/shoplist',
    component: () => import('@/views/Car/index.vue'),
  },
  {
    path: '/redio',
    component: () => import('@/views/streaming/redio.vue'),
  },
  {
    path: '/detail/:id',
    component: () => import('@/views/Detail/index.vue'),
    children: [
      {
        path: '/detail/pj',
        component: () => import('@/views/Detail/Children/pj'),
      },
      {
        path: '/detail/xq',
        component: () => import('@/views/Detail/Children/xq'),
      },
    ],
  },
  {
    path: '/orderlist',
    component: () => import('@/views/orderList/index.vue'),
  },
  {
    path: '/orderdetail',
    component: () => import('@/views/orderDetail/index.vue'),
  },
  {
    path: '/cardlist',
    component: () => import('@/views/card/allCard.vue'),
  },
  {
    path: '/addcard',
    component: () => import('@/views/card/addCard.vue'),
  },
  {
    path: '/cardinfo',
    component: () => import('@/views/card/cardInfo.vue'),
  },
  {
    path: '/cardlast',
    component: () => import('@/views/card/cardLast.vue'),
  },
  {
    path: '/cart',
    component: () => import('@/views/Cars/index.vue'),
  },
  {
    path: '/pay',
    component: () => import('@/views/pay/index.vue'),
  },
  {
    path: '/regist',
    component: () => import('@/views/regist/regist.vue'),
  },
  {
    path: '/copy',
    component: () => import('@/views/Copy/index.vue'),
  },
  {
    path: '/clip',
    component: () => import('@/views/Clipboard/index.vue'),
  },
  {
    path: '/bargain',
    component: () => import('@/views/Bargain/index.vue'),
  },
  {
    path: '/add',
    component: () => import('@/views/Address/index.vue'),
  },
  {
    path: '/examine',
    component: () => import('@/views/Examine/index.vue'),
  },
  {
    path: '/cheapdetail',
    component: () => import('@/views/cheapDetail/index.vue'),
  },
  {
    path: '/harea',
    component: () => import('@/views/Harea/Harea.vue'),
  },
  {
    path: '/addharea',
    component: () => import('@/views/Harea/addArea.vue'),
  },
  {
    path: '/shopticket',
    component: () => import('@/views/shopTicket/index.vue'),
  },
  {
    path: '/team',
    component: () => import('@/views/Team/index.vue'),
  },
  {
    path: '/teamDetail',
    component: () => import('@/views/TeamDetail/index.vue'),
  },
]

const router = new VueRouter({
  mode: 'hash',
  base: process.env.BASE_URL,
  routes,
})

export default router
